<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <style>
        .red{
            background-color:red;
        }
        .green{
            background-color: green;
        }
        .h1{
            font-size: 30px;
        }
        .blod{
            font-weight: 700;
        }
    </style>
</head>
<body>
    <div id="app">
        <div :class="isActive?'red':'green'">
            我是动态绑定class-三目写法
        </div>
        <div :class="classObj">
            我是动态绑定class-对象写法
        </div>
        <div :class="classArr">
            我是动态绑定class-数组写法
        </div>
    </div>

    <script>
        let vm = new Vue({
            el: '#app',
            data: {
                isActive: false,
                classObj:{
                    h1: true,
                    blod: true
                },
                classArr: ["red","h1"]
            } 
        })
    </script>
</body>
</html>